﻿using FCS;
using LooseChart;
using System;
using System.Collections.Generic;
using System.Windows;

namespace Test
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            for (int i = 0; i < 3000; i++)
            {
                xs1.Add(i * 20);
                ys1.Add(random.Next(500000));
            }
        }

        Random random = new Random();

        List<double> xs1 = new List<double>();
        List<double> ys1 = new List<double>();
        private void LoadData_Click(object sender, RoutedEventArgs e)
        {
            this.series1.DisplayColor = LooseChart.ISeries.RandomColor();
            this.series1.XSource = xs1;
            this.series1.YSource = ys1;
        }

        private void ReadFCS_Click(object sender, RoutedEventArgs e)
        {
            var fcs = FCS.Factory.ReadFileOneDataset("Sample_003.fcs");
            this.series1.DisplayColor = LooseChart.ISeries.RandomColor();
            this.series1.XSource = fcs.Measurements[12].ChannelValues;
            this.series1.YSource = fcs.Measurements[15].ChannelValues;
        }

        private void Clear_Click(object sender, RoutedEventArgs e)
        {
            this.series1.XSource = this.series1.YSource = null;
        }

        private void series_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
        {
            //if (sender is ISeries series) series.StrokeThickness = 3;
        }

        private void series_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            //if (sender is ISeries series) series.StrokeThickness = 1;
        }
    }

}
